package com.mytinyRPC.protocol;


import com.mytinyRPC.framework.URL;
import com.mytinyRPC.provider.LocalRegister;
import com.mytinyRPC.register.ServiceRegistry;

import java.lang.annotation.Annotation;
import java.net.InetSocketAddress;

public class AbstractRpcServer implements RpcServer {

    URL url;

    protected LocalRegister localRegister;
    protected ServiceRegistry serviceRegistry;



    @Override
    public void start(URL url) {
        this.url=url;

    }

    @Override
    public <T> void publishService(T service, String serviceName) {
        localRegister.regist(serviceName,service.getClass());

        serviceRegistry.registerService(serviceName, url);

    }
}
